<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  /*
  * 1 : 1   n1 = 1
  * 2 : 2   n2 = 2
  * 3 : 3   n3 = n1 + n2
  * 4 : 5   n4 = n2 + n3
  * 5 : 8
  * 6 : 13
  * 7 : 21
  * 8 : 34
  * 9 : 55
  * 10 : 89
  * n = (n-1) + (n-2)
  *
  * 2^N N^2
  *
  * */

  let count = 0;
  function xiaoqingwa(m) {// 有几个台阶
    // n和m是什么关系  N(m) = (N(m-1) + N(m+1))
    count++;
    if (m === 1) {
      return 1;
    }
    if (m === 2) {
      return 2;
    }
    // 尾递归
    return xiaoqingwa(m - 1) + xiaoqingwa(m - 2);
  }

  xiaoqingwa(1);
  console.log(1, count,Math.pow(1,2)); // 1
  xiaoqingwa(2);
  console.log(2, count,Math.pow(2,2)); // 2
  xiaoqingwa(3);
  console.log(3, count,Math.pow(3,2)); // 3
  xiaoqingwa(4);
  console.log(4, count,Math.pow(4,2)); // 2+3
  xiaoqingwa(5);
  console.log(5, count,Math.pow(5,2)); // 8
  xiaoqingwa(6);
  console.log(6, count,Math.pow(6,2)); // 13
  xiaoqingwa(7);
  console.log(7, count,Math.pow(7,2)); // 21
  xiaoqingwa(8);
  console.log(8, count,Math.pow(8,2)); // 21
  xiaoqingwa(9);
  console.log(9, count,Math.pow(9,2)); // 21
  xiaoqingwa(10);
  console.log(10, count,Math.pow(10,2)); // 21
  xiaoqingwa(11);
  console.log(11, count,Math.pow(11,2)); // 21

  xiaoqingwa(12);
  console.log(12, count,Math.pow(12,2)); // 21

  xiaoqingwa(13);
  console.log(13, count,Math.pow(13,2)); // 21





</script>
</body>
</html>
